Arduino Node
With the Arduino board, you can create an interface to test external hardware. TPT supports the Arduino Mega 2560 by itself.
The Arduino board acts as a kind of HiL. TPT sends data to and receives data from the Arduino board. The Arduino board handles the actual connection to the system under test.
TPT is connected to the board using a standard Arduino USB cable. The communication is performed via the PWM pin 0 (RX) and PWM pin 1 (TX). PWM stands for pulse width modulation, where 0 is interpreted as "always off" and 255 as "always on". More about PWM, see https://www.arduino.cc/en/Tutorial/PWM.
In order to send data to the Arduino board, you must create output channels in TPT for the digital and analog outputs of the Arduino board. To receive data from the Arduino board, you must create input channels for the digital and analog inputs of the Arduino board, see Declaration Editor.
Each pin on the Arduino board has a name that is either a number or a combination of a letter and a number. The behavior of these pins is specified in the so-called Arduino protocol, see Arduino Node - Protocol. To establish a connection between the Arduino board and TPT, handles must be provided. The handle names in TPT reflect the purpose of the Arduino pin declaration:
|
|
|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
The following image shows how the pins are mapped in the Declaration Editor to the real pins at the Arduino board when the standard example is used (Arduino Node Example, Arduino from Scratch example).
In the provided Mega2560.ino
it is specified that TPT uses a protocol that enables 16 digital in pins and 16 analog in pins. The analog in pins (A0 to A15) can handle values up to 3FF (= 1.023). The analog out pins can handle values up to FF (= 255) as a PWM value.
COM Port
By default is COM Port is set to COMxx. Replace the xx by the communication port the Arduino board uses.
You can find the COM port of the Arduino board either in the Windows Device Manger ("Device Manager|Ports (COM & LTP)") or in the Arduino IDE ("Tools|Ports").
Baudrate
The baudrate refers to the rate of data transmission measured in baud. The baudrate is specified in the Arduino sketch. By default, 2.000.000 is set as baudrate in the TPT Arduino Node. If needed, change it to the baudrate specified in your Arduino sketch.
Mapping
Select a mapping from the drop-down list. The mapping must contain a Rename mapping flavor, see Mapping Flavor - Rename, or Scaling mapping flavor, see Mapping Flavor - Scaling, o rboth.